<!--
 * @Author: Haochen
 * @Date: 2021-12-07 16:45:01
 * @LastEditTime: 2021-12-07 17:04:10
 * @FilePath: \students-system\src\views\Error.vue
-->
<template>
  <div>
    页面走丢了
    <p v-text="countDown"></p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      countDown: 5,
    };
  },

  methods: {
    decrement() {
      this.countDown--;
      return;
    },
  },

  mounted() {
    const timer = setInterval(() => {
      this.countDown--;
      if (this.countDown <= 0) {
        clearInterval(timer);
        this.$router.push('/');
      }
    }, 1000);
  },

  //   watch: {
  //     countDown() {
  //       while (this.countDown !== 0) {
  //
  //       }

  //       //   this.$router.push('/');
  //     },
  //   },
};
</script>

<style></style>
